package com.num2.controller.lkw;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.num2.form.lkw.Balance_Money;
import com.num2.model.lkw.BalanceModel;
import com.num2.service.lkw.BalanceService;

@Controller
public class BalanceCtrl {
	@Resource
	private BalanceService balanceservice;
	@RequestMapping("/balance")
	public String balanceMoney(Balance_Money bm,HttpSession session,Model m){
			BalanceModel balancemodel = balanceservice.selectMoney(bm,session);
			  if (balancemodel != null) {
		            m.addAttribute("balance",balancemodel.getBalance());
				return "demo/balance";
			}else{
				return "demo/balance";
			}
		}
	public BalanceService getBalanceservice() {
		return balanceservice;
	}
	public void setBalanceservice(BalanceService balanceservice) {
		this.balanceservice = balanceservice;
	}
	
	
}
